-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: reduce amount of scalac dependencies #2048
Conversation
@@ -0,0 +1,10 @@ | |||
package scala.meta.internal.symtab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not super happy about this hack, since eventual drift between this version and the upstream one will cause runtime errors in reflect and cli, but for the foreseeable future tests should pick that up and I think it's worth it to keep core clean until we contractualize with scalameta what could be exposed as a public API.
@@ -41,6 +41,7 @@ object Dependencies { | |||
val scalatest = "org.scalatest" %% "scalatest" % scalatestV | |||
val munit = "org.scalameta" %% "munit" % munitV | |||
val semanticdbScalacCore = "org.scalameta" % "semanticdb-scalac-core" % scalametaV cross CrossVersion.full | |||
val semanticdbSharedFor3Use2_13 = "org.scalameta" % "semanticdb-shared" % scalametaV cross CrossVersion.for3Use2_13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leverage scalameta/scalameta#3887
@@ -149,6 +148,7 @@ lazy val reflect = projectMatrix | |||
moduleName := "scalafix-reflect", | |||
isFullCrossVersion, | |||
libraryDependencies ++= Seq( | |||
semanticdbScalacCore, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but this change highlights a limitation: I wonder how much of the current implementation of GlobalSymbolTable
works against class files produced by dotty.... We haven't got any issue but I guess it's just because the Symbol lookup API is not used much on symbols that are not in the document, or maybe it's mostly on Java and Scala standard library classes.
scalafix/scalafix-core/src/main/scala/scalafix/internal/v1/InternalSemanticDoc.scala
Line 80 in c6d7411
fromTextDocument().orElse(fromGlobalSymtab) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follows #2047 / scalameta/scalameta#3747
See initial discussion in #2024 (comment)
I initially tried to inline everything that was needed from semanticdb-scalac-core, but I ended up pulling pretty much everything.... It's not a big difference compared to before anyway, as the Scala 2 compiler is brought by scalameta (the main artifact). As discussed in one of the comment, that logic will have to be revisited anyway to better support Scala 3 (#2049), so I am not sure it's worth investing time on that now.